<template>
  <div class="tech-footer">
    <div class="container">
      <div class="footer-content">
        <div class="footer-info">
          <div class="footer-logo">
            <el-icon class="logo-icon" size="24">
              <DataLine />
            </el-icon>
            <span class="logo-text gradient-text">TechNova</span>
          </div>
          <p class="footer-desc">探索科技前沿，洞察未来趋势</p>
        </div>
        
        <div class="footer-links">
          <div class="link-group">
            <h4>分类</h4>
            <ul>
              <li><router-link to="/ai">人工智能</router-link></li>
              <li><router-link to="/blockchain">区块链</router-link></li>
              <li><router-link to="/hardware">硬件</router-link></li>
              <li><router-link to="/startup">创业</router-link></li>
            </ul>
          </div>
          
          <div class="link-group">
            <h4>关于</h4>
            <ul>
              <li><a href="#about">关于我们</a></li>
              <li><a href="#contact">联系我们</a></li>
              <li><a href="#privacy">隐私政策</a></li>
              <li><a href="#terms">使用条款</a></li>
            </ul>
          </div>
        </div>
      </div>
      
      <div class="footer-bottom">
        <div class="copyright">
          <p>&copy; 2025 TechNova. Made with ❤️ using Vue 3 & Element Plus</p>
        </div>
        <div class="tech-stats">
          <span class="stat-item">
            <el-icon><View /></el-icon>
            {{ formatNumber(12345) }} 次访问
          </span>
          <span class="stat-item">
            <el-icon><Document /></el-icon>
            {{ formatNumber(567) }} 篇文章
          </span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { DataLine, View, Document } from '@element-plus/icons-vue'

const formatNumber = (num: number): string => {
  if (num >= 10000) {
    return (num / 10000).toFixed(1) + 'w'
  } else if (num >= 1000) {
    return (num / 1000).toFixed(1) + 'k'
  }
  return num.toString()
}
</script>

<style scoped lang="scss">
.tech-footer {
  padding: 40px 0 20px;
  background: linear-gradient(135deg, var(--tech-bg-secondary), rgba(21, 21, 32, 0.9));
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tech-accent-neon), transparent);
  }
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-info {
  .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    
    .logo-icon {
      color: var(--tech-accent-neon);
    }
    
    .logo-text {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: 1px;
    }
  }
  
  .footer-desc {
    color: var(--tech-text-secondary);
    font-size: 16px;
    line-height: 1.6;
  }
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  
  .link-group {
    h4 {
      color: var(--tech-accent-neon);
      font-size: 16px;
      margin-bottom: 16px;
      position: relative;
      
      &::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 30px;
        height: 2px;
        background: var(--tech-gradient-accent);
      }
    }
    
    ul {
      list-style: none;
      
      li {
        margin-bottom: 8px;
        
        a {
          color: var(--tech-text-secondary);
          text-decoration: none;
          transition: all var(--tech-transition-normal) ease;
          
          &:hover {
            color: var(--tech-accent-neon);
            text-shadow: 0 0 8px currentColor;
          }
        }
      }
    }
  }
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  
  .copyright {
    color: var(--tech-text-muted);
    font-size: 14px;
  }
  
  .tech-stats {
    display: flex;
    gap: 20px;
    
    .stat-item {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--tech-text-secondary);
      font-size: 14px;
      
      .el-icon {
        color: var(--tech-accent-neon);
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    
    .tech-stats {
      justify-content: center;
    }
  }
}
</style>